package com.eastfair.venuebooking.api;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.eastfair.boot.request.PageParams;
import com.eastfair.core.base.R;
import com.eastfair.venueservice.dto.WorkOvertimeDTO;
import com.eastfair.venueservice.entity.WorkOvertime;
import com.eastfair.venueservice.vo.WorkOvertimeVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * 加班申请 Feign.
 *
 * @author dqq
 * @date 2022/10/20
 */
@FeignClient("venue-services-manage/workOvertime")
public interface WorkOvertimeFeign {

    /**
     * 分页查询加班申请列表VO.
     *
     * @param pageParams the page params
     * @return the r
     */
    @PostMapping("/query/workOvertime")
    R<Page<WorkOvertimeVO>> queryWorkOvertime(@RequestBody PageParams<WorkOvertimeDTO> pageParams);

    /**
     * 分页查询加班申请列表VO.
     *
     * @param query the page params
     * @return the r
     */
    @PostMapping("/query/workOvertime/list")
    R<List<WorkOvertimeVO>> queryWorkOvertime(@RequestBody WorkOvertimeDTO query);

    /**
     * 加班单号获取加班详情VO.
     *
     * @param workOvertimeNumber the work overtime number
     * @return the by work overtime number
     */
    @GetMapping("/get/{workOvertimeNumber}")
    R<WorkOvertimeVO> getByWorkOvertimeNumber(@PathVariable("workOvertimeNumber") String workOvertimeNumber);

    /**
     * 保存加班申请.
     *
     * @param workOvertimeDTO the work overtime dto
     * @return the r
     */
    @PostMapping("/save")
    R<WorkOvertime> saveWorkOvertime(@RequestBody WorkOvertimeDTO workOvertimeDTO);

    /**
     * 更新加班申请.
     *
     * @param workOvertimeDTO the work overtime dto
     * @return the r
     */
    @PostMapping("/update")
    R<WorkOvertime> updateWorkOvertime(@RequestBody WorkOvertimeDTO workOvertimeDTO);

    /**
     * 提交加班申请.
     *
     * @param workOvertimeDTO the work overtime dto
     * @return the r
     */
    @PostMapping("/submit")
    R<Boolean> submitWorkOvertime(@RequestBody WorkOvertimeDTO workOvertimeDTO);

    /**
     * 取消申请.
     *
     * @param workOvertimeNumber the work overtime number
     * @return the r
     */
    @GetMapping("/cancel/{workOvertimeNumber}")
    R<Boolean> cancelWorkOvertime(@PathVariable("workOvertimeNumber") String workOvertimeNumber);

    /**
     * 更新审核结果.
     *
     * @param workOvertimeDTO the work overtime dto
     * @return the r
     */
    @PostMapping("/audit")
    R<Boolean> auditWorkOvertime(@RequestBody WorkOvertimeDTO workOvertimeDTO);

    /**
     * 更新支付结果.
     *
     * @param workOvertimeDTO the work overtime dto
     * @return the r
     */
    @PostMapping("/update/payStatus")
    R<Boolean> updatePayStatus(@RequestBody WorkOvertimeDTO workOvertimeDTO);

    /**
     * 加班单号删除.
     *
     * @param workOvertimeNumber the ids
     * @return the r
     */
    @GetMapping("/remove/{workOvertimeNumber}")
    R<Boolean> removeByWorkOvertimeNumber(@PathVariable("workOvertimeNumber") String workOvertimeNumber);
}